Repository navigation
Let embedders set the output gate timeout - #8879
Conversation
A Durable Object storage operation that holds the output gate for 30 seconds breaks the gate and resets the object. The 30 seconds was hard-coded in Worker::Actor, so a test that exercises the timeout had to wait it out. Add IsolateLimitEnforcer::getOutputGateTimeout(), which defaults to the same 30 seconds, and read it when the actor is constructed. An embedder can then lower it, for example in tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💬 Approved with comments — The change is correct and doesn't alter behaviour for enforcers that keep the default. The only note is an INFO: no test yet uses an overridden timeout.
Findings: 1 info (1 is an inline comment on the diff)
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
📋 Code Quality: 💬 1 info
The change is correct and keeps the old behaviour by default; the new hook has no test yet.
Recommendation: 💬 Optional Nits
- [INFO] New
getOutputGateTimeout()hook has no test that an overridden value reaches the actor's output gate. (src/workerd/io/limit-enforcer.h:115)
View full review
The new hook is wired correctly. worker is initialized before impl is constructed, the HooksImpl members are initialized in declaration order, and the 30-second default matches the old hard-coded value. One optional note: nothing yet tests that an overridden timeout is the one the output gate uses.
✅ All other checks passed
🔒 Security: ✅ LGTM
Only embedder code can change the timeout, by overriding a virtual method on the limit enforcer. Worker input never reaches it. The change adds no new way in, and the default stays the same.
📝 Documentation: ✅ LGTM
The comment on the new method describes the current behaviour and keeps the warning about lowering the timeout in production.
Reviewed commit: e3f130a1
A Durable Object storage operation that holds the output gate for 30 seconds breaks the gate and resets the object. The 30 seconds was hard-coded in
Worker::Actor, so a test that exercises the timeout had to wait it out.This adds
IsolateLimitEnforcer::getOutputGateTimeout(), which defaults to the same 30 seconds, and reads it when the actor is constructed. An embedder can then lower it, for example in tests. Behavior is unchanged for any enforcer that doesn't override it.🤖 Generated with Claude Code